﻿using MayhemWpf.UserControls;

namespace CMD
{
    public partial class SetCMDConfig : WpfConfiguration
    {
       
        public string Command
        {
            get;
            private set;
        }

        public bool CloseWindow
        {
            get;
            private set;
        }

        public SetCMDConfig(string command, bool closeWindow)
        {
            this.Command = command;
            this.CloseWindow = closeWindow;
            InitializeComponent();
        }

        public override void OnLoad()
        {
            inputBox.Text = this.Command;
            CanSave = true;
            closeWindow.IsChecked = this.CloseWindow;
            CanSave = true;
        }

        public override void OnSave()
        {
            this.Command = inputBox.Text;
            this.CloseWindow = (bool)closeWindow.IsChecked;
        }

        public override string Title
        {
            get
            {
                return "Set Command..";
            }
        }
    }
}
